import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class test10 {
	public static void main(String[] args) {
		String BookName=null;
		int location=5;
		book name[]= new book[location];
		System.out.println("Enter the book name");
		BufferedReader brObj= new BufferedReader(new InputStreamReader(System.in));
		try {
			int i=0;
			while(i<5){
			name[i]=new book();
			name[i].setBookName(brObj.readLine());
			System.out.println("Book added to successfully:"+i);
			i++;
			}
			int j=0;
			while(i>j){
			System.out.println("Enter the book location");
			//name[j].getBookName();
			String temp =name[j].getBookName();
			System.out.println("Book name is:"+temp);
			j++;
			}

		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}